//
//  ObserveButton.swift
//  Employee
//
//  Created by swordjoy on 2017/3/28.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import UIKit

class ObserveButton: UIButton {
  
  // 用来判断是否可以点击,YES可以点击
  override var isSelected: Bool {
    didSet {
      isUserInteractionEnabled = isSelected
      if isSelected {
        setTitleColor(GlobalConfig.BGSkyBlueColor, for: .normal)
      } else {
        setTitleColor(GlobalConfig.TextLightColor, for: .normal)
      }
    }
  }
  
  override init(frame: CGRect) {
    super.init(frame: frame)
    setTitleColor(GlobalConfig.TextLightColor, for: .normal)
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

}
